<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<title>无标题文档</title>
	<link href="/static/css/default.css" rel="stylesheet" type="text/css">
	<link href="/static/css/style/green.css" rel="stylesheet" type="text/css" id='link'>
	<link rel="stylesheet" href="/static/FileUpload/css/jquery.fileupload.css" />
</head>

<body style="overflow:hidden; padding:10px;">
	<form>
		<div id="app">
			<table class="formtable" style="width:580px;">

				<tbody>
					<tr>
						<td>微信昵称</td>
						<td>手机号</td>
						<td>关系</td>
						<td>绑定时间</td>
						<td>操作</td>
					</tr>
					<tr v-for="uitem in arrayData">
						<td>{{uitem.nickname}}</td>
						<td>{{uitem.phone}}</td>
						<td>{{uitem.relation}}</td>
						<td>{{uitem.createtime}}</td>
						<td>
					
								<a v-on:click="jiebang(uitem)">解绑</a>
						</td>
					</tr>

				</tbody>
			</table>
			

		
			<input type="hidden" id="studentid" value="{$id}" />
			
		</div>
	</form>


</body>
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/js/vue2.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script src="/static/FileUpload/js/vendor/jquery.ui.widget.js"></script>
<script src="/static/FileUpload/js/jquery.iframe-transport.js"></script>
<script src="/static/FileUpload/js/jquery.fileupload.js"></script>
<script>
	
	var app = new Vue({
		el: '#app',
		data: {
			arrayData: []
		},
		methods: {
			getdata: function () {
				var _self = this;//保存this的指向
				var studentid =$("#studentid").val();
				$.post('/Index/Student/get_studentandparent', {studentid:studentid},function (data) {
					_self.arrayData = data.list;
				});
			},
			jiebang: function (uitem) {
				var self = this;
			
				parent.layer.confirm('确定要解绑吗?', {
					btn: ['是', '否'] //按钮
				}, function () {
					
					$.post("/Index/User/jiebang", { "id": uitem.id }, function (data) {
						parent.layer.closeAll('dialog');
						if (data.status == 200) {
							layer.msg(data.message);
							self.getdata("");
							window.parent.reloadiframe();
						} else {
							layer.msg(data.message);
						}
					});
				}, function () {

				});

			},
			

		},
		created: function () {  //初始化事件里边去调用查询方法
			this.getdata();
		}
	});

	


</script>

</html>